#include<iostream>
#include<memory>

#include "udpserver.hpp"

std::string handler(const std::string& s)
{
    std::string res = "Server get a message: ";
    res += s;
    //std::cout << res << std::endl;
    return res;
}

int main()
{
    std::unique_ptr<udpserver>udp(new udpserver); //智能指针
    //1.服务器初始化
    udp->Start();

    //2.运行服务器
    udp->Run(handler);
    return 0;
}